<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/irq.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('irq_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">irq.h</div></div>
</div><!--header-->
<div class="contents">
<a href="irq_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_IRQ_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_IRQ_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="comment">// These two config items are also used by assembler, so keeping separate</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="comment">// PICO_CONFIG: PICO_MAX_SHARED_IRQ_HANDLERS, Maximum number of shared IRQ handlers, default=4, advanced=true, group=hardware_irq</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#ifndef PICO_MAX_SHARED_IRQ_HANDLERS</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#define PICO_MAX_SHARED_IRQ_HANDLERS 4</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="comment">// PICO_CONFIG: PICO_DISABLE_SHARED_IRQ_HANDLERS, Disable shared IRQ handlers, type=bool, default=0, group=hardware_irq</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#ifndef PICO_DISABLE_SHARED_IRQ_HANDLERS</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#define PICO_DISABLE_SHARED_IRQ_HANDLERS 0</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span><span class="comment">// PICO_CONFIG: PICO_VTABLE_PER_CORE, user is using separate vector tables per core, type=bool, default=0, group=hardware_irq</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#ifndef PICO_VTABLE_PER_CORE</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">#define PICO_VTABLE_PER_CORE 0</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="preprocessor">#ifndef __ASSEMBLER__</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#include &quot;<a class="code" href="address__mapped_8h.html">hardware/address_mapped.h</a>&quot;</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#include &quot;hardware/regs/intctrl.h&quot;</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#include &quot;pico/platform/cpu_regs.h&quot;</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span> </div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_IRQ_PRIORITY, Define the default IRQ priority, default=0x80, group=hardware_irq</span></div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span><span class="preprocessor">#ifndef PICO_DEFAULT_IRQ_PRIORITY</span></div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span><span class="preprocessor">#define PICO_DEFAULT_IRQ_PRIORITY 0x80</span></div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span> </div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span><span class="preprocessor">#define PICO_LOWEST_IRQ_PRIORITY 0xff</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span><span class="preprocessor">#define PICO_HIGHEST_IRQ_PRIORITY 0x00</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span><span class="comment">// PICO_CONFIG: PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY, Set default shared IRQ order priority, default=0x80, group=hardware_irq</span></div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span><span class="preprocessor">#ifndef PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span><span class="preprocessor">#define PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY 0x80</span></div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span> </div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span><span class="preprocessor">#define PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY 0xff</span></div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span><span class="preprocessor">#define PICO_SHARED_IRQ_HANDLER_LOWEST_ORDER_PRIORITY 0x00</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ, Enable/disable assertions in the hardware_irq module, type=bool, default=0, group=hardware_irq</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_IRQ </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ PARAM_ASSERTIONS_ENABLED_IRQ</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_IRQ 0</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span> </div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span> </div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"><a class="line" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">  195</a></span><span class="keyword">typedef</span> void (*<a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a>)(void);</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span> </div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> check_irq_param(__unused uint num) {</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>    invalid_params_if(HARDWARE_IRQ, num &gt;= NUM_IRQS);</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>}</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span> </div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gad11ea172f11d9763647ac34b366ab3c2">irq_set_priority</a>(uint num, uint8_t hardware_priority);</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span> </div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>uint <a class="code hl_function" href="group__hardware__irq.html#ga6bcde7d99ca71abe8dccfd13b4d80b29">irq_get_priority</a>(uint num);</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span> </div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#ga7c7167f643c6898b758340ce59d333d9">irq_set_enabled</a>(uint num, <span class="keywordtype">bool</span> enabled);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span> </div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__irq.html#ga0c54ae4c0593c2a8596b99cd167584e0">irq_is_enabled</a>(uint num);</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gae91340b84a6d70049933af657df93201">irq_set_mask_enabled</a>(uint32_t mask, <span class="keywordtype">bool</span> enabled);</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span> </div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gae1a927e62e780b2f7dacc3a008ffaf20">irq_set_mask_n_enabled</a>(uint n, uint32_t mask, <span class="keywordtype">bool</span> enabled);</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span> </div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gafffd448ba2d2eef5b355b88180aefe7f">irq_set_exclusive_handler</a>(uint num, <a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> handler);</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span> </div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span><a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> <a class="code hl_function" href="group__hardware__irq.html#ga42e9cdce7b82ef63c7b2416d32a42361">irq_get_exclusive_handler</a>(uint num);</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno">  307</span> </div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gaf02f8599896c66f4579c845a96b2126e">irq_add_shared_handler</a>(uint num, <a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> handler, uint8_t order_priority);</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span> </div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno">  350</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gadfd3308952d41ee91671ae098b867a90">irq_remove_handler</a>(uint num, <a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> handler);</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno">  351</span> </div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno">  358</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__irq.html#gae552cab9da1b37a785791f678090f418">irq_has_shared_handler</a>(uint num);</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno">  359</span> </div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span><a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> <a class="code hl_function" href="group__hardware__irq.html#ga4f9772d9d1781c3a28371623886a0310">irq_get_vtable_handler</a>(uint num);</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span> </div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"><a class="line" href="group__hardware__irq.html#ga14fa98b8bec09df3e7409a75cf2f5359">  378</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#ga14fa98b8bec09df3e7409a75cf2f5359">irq_clear</a>(uint int_num) {</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno">  379</span><span class="preprocessor">#if PICO_RP2040</span></div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span>    *((<span class="keyword">volatile</span> uint32_t *) (PPB_BASE + M0PLUS_NVIC_ICPR_OFFSET)) = (1u &lt;&lt; ((uint32_t) (int_num &amp; 0x1F)));</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span><span class="preprocessor">#elif defined(__riscv)</span></div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>    <span class="comment">// External IRQs are not latched, but we should clear the IRQ force bit here</span></div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span>    hazard3_irqarray_clear(RVCSR_MEIFA_OFFSET, int_num / 16, 1u &lt;&lt; (int_num % 16));</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno">  385</span>    nvic_hw-&gt;icpr[int_num/32] = 1 &lt;&lt; (int_num % 32);</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno">  386</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno">  387</span>}</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno">  388</span> </div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#ga36e4b97d3414ce58c3091e63badcf9ce">irq_set_pending</a>(uint num);</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno">  397</span> </div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span> </div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno">  403</span><span class="keywordtype">void</span> <a class="code hl_function" href="irq_8h.html#a6b1e04e66cf95ecf11a58beda886255d">runtime_init_per_core_irq_priorities</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno">  404</span> </div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno">  405</span><span class="keyword">static</span> <a class="code hl_define" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> <span class="keywordtype">void</span> irq_init_priorities(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno">  406</span>    <a class="code hl_function" href="irq_8h.html#a6b1e04e66cf95ecf11a58beda886255d">runtime_init_per_core_irq_priorities</a>();</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno">  407</span>}</div>
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno">  408</span> </div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno">  421</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#gaa52ec9e5f572b3a0ef50707ab37233ef">user_irq_claim</a>(uint irq_num);</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno">  422</span> </div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno">  437</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__irq.html#ga14c041e05fbd5ee3c0b6b6341073a20a">user_irq_unclaim</a>(uint irq_num);</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno">  438</span> </div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno">  452</span><span class="keywordtype">int</span> <a class="code hl_function" href="group__hardware__irq.html#gace889ebb0bde6fc678dee915d4e3537e">user_irq_claim_unused</a>(<span class="keywordtype">bool</span> required);</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno">  453</span> </div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno">  454</span><span class="comment">/*</span></div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno">  455</span><span class="comment">*! \brief Check if a user IRQ is in use on the calling core</span></div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno">  456</span><span class="comment"> *  \ingroup hardware_irq</span></div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno">  457</span><span class="comment"> *  </span></div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno">  458</span><span class="comment"> * User IRQs starting from FIRST_USER_IRQ are not connected to any hardware, but can be triggered by \ref irq_set_pending.</span></div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno">  459</span><span class="comment"> *</span></div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno">  460</span><span class="comment"> * \note User IRQs are a core local feature; they cannot be used to communicate between cores. Therefore all functions</span></div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno">  461</span><span class="comment"> * dealing with Uer IRQs affect only the calling core</span></div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno">  462</span><span class="comment"> *</span></div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno">  463</span><span class="comment"> * \param irq_num the irq irq_num</span></div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span><span class="comment"> * \return true if the irq_num is claimed, false otherwise</span></div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span><span class="comment"> * \sa user_irq_claim</span></div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span><span class="comment"> * \sa user_irq_unclaim</span></div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno">  467</span><span class="comment"> * \sa user_irq_claim_unused</span></div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno">  468</span><span class="comment"> */</span></div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno">  469</span><span class="keywordtype">bool</span> user_irq_is_claimed(uint irq_num);</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno">  470</span> </div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno">  471</span><span class="keywordtype">void</span> __unhandled_user_irq(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span> </div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno">  473</span><span class="preprocessor">#ifdef __riscv</span></div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno">  474</span><span class="keyword">enum</span> riscv_vector_num {</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno">  475</span>    RISCV_VEC_MACHINE_EXCEPTION = 0,</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno">  476</span>    RISCV_VEC_MACHINE_SOFTWARE_IRQ = 3,</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span>    RISCV_VEC_MACHINE_TIMER_IRQ = 7,</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno">  478</span>    RISCV_VEC_MACHINE_EXTERNAL_IRQ = 11,</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span>};</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno">  480</span> </div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno">  481</span><a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> irq_set_riscv_vector_handler(<span class="keyword">enum</span> riscv_vector_num index, <a class="code hl_typedef" href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a> handler);</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno">  482</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span> </div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span><span class="preprocessor">#if PICO_SECURE</span></div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> irq_assign_to_ns(uint irq_num, <span class="keywordtype">bool</span> ns) {</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span>    check_irq_param(irq_num);</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno">  487</span>    <span class="keywordflow">if</span> (ns) nvic_hw-&gt;itns[irq_num &gt;&gt; 5] |= 1u &lt;&lt; (irq_num &amp; 0x1fu);</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno">  488</span>    <span class="keywordflow">else</span> nvic_hw-&gt;itns[irq_num &gt;&gt; 5] &amp;= ~(1u &lt;&lt; (irq_num &amp; 0x1fu));</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno">  489</span>}</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno">  490</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno">  491</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno">  492</span>}</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno">  493</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span> </div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="aaddress__mapped_8h_html"><div class="ttname"><a href="address__mapped_8h.html">address_mapped.h</a></div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga0c54ae4c0593c2a8596b99cd167584e0"><div class="ttname"><a href="group__hardware__irq.html#ga0c54ae4c0593c2a8596b99cd167584e0">irq_is_enabled</a></div><div class="ttdeci">bool irq_is_enabled(uint num)</div><div class="ttdoc">Determine if a specific interrupt is enabled on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:67</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga14c041e05fbd5ee3c0b6b6341073a20a"><div class="ttname"><a href="group__hardware__irq.html#ga14c041e05fbd5ee3c0b6b6341073a20a">user_irq_unclaim</a></div><div class="ttdeci">void user_irq_unclaim(uint irq_num)</div><div class="ttdoc">Mark a user IRQ as no longer used on the calling core.</div><div class="ttdef"><b>Definition:</b> irq.c:679</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga14fa98b8bec09df3e7409a75cf2f5359"><div class="ttname"><a href="group__hardware__irq.html#ga14fa98b8bec09df3e7409a75cf2f5359">irq_clear</a></div><div class="ttdeci">static void irq_clear(uint int_num)</div><div class="ttdoc">Clear a specific interrupt on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.h:378</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga36e4b97d3414ce58c3091e63badcf9ce"><div class="ttname"><a href="group__hardware__irq.html#ga36e4b97d3414ce58c3091e63badcf9ce">irq_set_pending</a></div><div class="ttdeci">void irq_set_pending(uint num)</div><div class="ttdoc">Force an interrupt to be pending on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:117</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga42e9cdce7b82ef63c7b2416d32a42361"><div class="ttname"><a href="group__hardware__irq.html#ga42e9cdce7b82ef63c7b2416d32a42361">irq_get_exclusive_handler</a></div><div class="ttdeci">irq_handler_t irq_get_exclusive_handler(uint num)</div><div class="ttdoc">Get the exclusive interrupt handler for an interrupt on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:232</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga4f9772d9d1781c3a28371623886a0310"><div class="ttname"><a href="group__hardware__irq.html#ga4f9772d9d1781c3a28371623886a0310">irq_get_vtable_handler</a></div><div class="ttdeci">irq_handler_t irq_get_vtable_handler(uint num)</div><div class="ttdoc">Get the current IRQ handler for the specified IRQ from the currently installed hardware vector table ...</div><div class="ttdef"><b>Definition:</b> irq.c:214</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga6bcde7d99ca71abe8dccfd13b4d80b29"><div class="ttname"><a href="group__hardware__irq.html#ga6bcde7d99ca71abe8dccfd13b4d80b29">irq_get_priority</a></div><div class="ttdeci">uint irq_get_priority(uint num)</div><div class="ttdoc">Get specified interrupt's priority.</div><div class="ttdef"><b>Definition:</b> irq.c:604</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga7c7167f643c6898b758340ce59d333d9"><div class="ttname"><a href="group__hardware__irq.html#ga7c7167f643c6898b758340ce59d333d9">irq_set_enabled</a></div><div class="ttdeci">void irq_set_enabled(uint num, bool enabled)</div><div class="ttdoc">Enable or disable a specific interrupt on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:61</div></div>
<div class="ttc" id="agroup__hardware__irq_html_ga8478ee26cc144e947ccd75b0169059a6"><div class="ttname"><a href="group__hardware__irq.html#ga8478ee26cc144e947ccd75b0169059a6">irq_handler_t</a></div><div class="ttdeci">void(* irq_handler_t)(void)</div><div class="ttdoc">Interrupt handler function type.</div><div class="ttdef"><b>Definition:</b> irq.h:195</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gaa52ec9e5f572b3a0ef50707ab37233ef"><div class="ttname"><a href="group__hardware__irq.html#gaa52ec9e5f572b3a0ef50707ab37233ef">user_irq_claim</a></div><div class="ttdeci">void user_irq_claim(uint irq_num)</div><div class="ttdoc">Claim ownership of a user IRQ on the calling core.</div><div class="ttdef"><b>Definition:</b> irq.c:675</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gace889ebb0bde6fc678dee915d4e3537e"><div class="ttname"><a href="group__hardware__irq.html#gace889ebb0bde6fc678dee915d4e3537e">user_irq_claim_unused</a></div><div class="ttdeci">int user_irq_claim_unused(bool required)</div><div class="ttdoc">Claim ownership of a free user IRQ on the calling core.</div><div class="ttdef"><b>Definition:</b> irq.c:683</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gad11ea172f11d9763647ac34b366ab3c2"><div class="ttname"><a href="group__hardware__irq.html#gad11ea172f11d9763647ac34b366ab3c2">irq_set_priority</a></div><div class="ttdeci">void irq_set_priority(uint num, uint8_t hardware_priority)</div><div class="ttdoc">Set specified interrupt's priority.</div><div class="ttdef"><b>Definition:</b> irq.c:587</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gadfd3308952d41ee91671ae098b867a90"><div class="ttname"><a href="group__hardware__irq.html#gadfd3308952d41ee91671ae098b867a90">irq_remove_handler</a></div><div class="ttdeci">void irq_remove_handler(uint num, irq_handler_t handler)</div><div class="ttdoc">Remove a specific interrupt handler for the given irq number on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:470</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gae1a927e62e780b2f7dacc3a008ffaf20"><div class="ttname"><a href="group__hardware__irq.html#gae1a927e62e780b2f7dacc3a008ffaf20">irq_set_mask_n_enabled</a></div><div class="ttdeci">void irq_set_mask_n_enabled(uint n, uint32_t mask, bool enabled)</div><div class="ttdoc">Enable/disable multiple interrupts on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:113</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gae552cab9da1b37a785791f678090f418"><div class="ttname"><a href="group__hardware__irq.html#gae552cab9da1b37a785791f678090f418">irq_has_shared_handler</a></div><div class="ttdeci">bool irq_has_shared_handler(uint num)</div><div class="ttdoc">Determine if the current handler for the given number is shared.</div><div class="ttdef"><b>Definition:</b> irq.c:200</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gae91340b84a6d70049933af657df93201"><div class="ttname"><a href="group__hardware__irq.html#gae91340b84a6d70049933af657df93201">irq_set_mask_enabled</a></div><div class="ttdeci">void irq_set_mask_enabled(uint32_t mask, bool enabled)</div><div class="ttdoc">Enable/disable multiple interrupts on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:109</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gaf02f8599896c66f4579c845a96b2126e"><div class="ttname"><a href="group__hardware__irq.html#gaf02f8599896c66f4579c845a96b2126e">irq_add_shared_handler</a></div><div class="ttdeci">void irq_add_shared_handler(uint num, irq_handler_t handler, uint8_t order_priority)</div><div class="ttdoc">Add a shared interrupt handler for an interrupt on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:356</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gafffd448ba2d2eef5b355b88180aefe7f"><div class="ttname"><a href="group__hardware__irq.html#gafffd448ba2d2eef5b355b88180aefe7f">irq_set_exclusive_handler</a></div><div class="ttdeci">void irq_set_exclusive_handler(uint num, irq_handler_t handler)</div><div class="ttdoc">Set an exclusive interrupt handler for an interrupt on the executing core.</div><div class="ttdef"><b>Definition:</b> irq.c:219</div></div>
<div class="ttc" id="agroup__pico__platform_html_ga23eadd8d1642fb8fe4600708c36e116a"><div class="ttname"><a href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a></div><div class="ttdeci">#define __force_inline</div><div class="ttdoc">Attribute to force inlining of a function regardless of optimization level.</div><div class="ttdef"><b>Definition:</b> compiler.h:125</div></div>
<div class="ttc" id="airq_8h_html_a6b1e04e66cf95ecf11a58beda886255d"><div class="ttname"><a href="irq_8h.html#a6b1e04e66cf95ecf11a58beda886255d">runtime_init_per_core_irq_priorities</a></div><div class="ttdeci">void runtime_init_per_core_irq_priorities(void)</div><div class="ttdoc">Perform IRQ priority initialization for the current core.</div><div class="ttdef"><b>Definition:</b> irq.c:651</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>